//
//  UIView+STALTool.m
//  stoneobs_alert_Example
//
//  Created by imac on 2019/6/27.
//  Copyright © 2019年 shixuanlei. All rights reserved.
//

#import "UIView+STALTool.h"

@implementation UIView (STALTool)
- (CGFloat)stal_left {
    return self.frame.origin.x;
}

- (void)setStal_left:(CGFloat)left {
    CGRect frame = self.frame;
    frame.origin.x = left;
    self.frame = frame;
}

- (CGFloat)stal_top {
    return self.frame.origin.y;
}

- (void)setStal_top:(CGFloat)top {
    CGRect frame = self.frame;
    frame.origin.y = top;
    self.frame = frame;
}

- (CGFloat)stal_right {
    return self.frame.origin.x + self.frame.size.width;
}

- (void)setStal_right:(CGFloat)right {
    CGRect frame = self.frame;
    frame.origin.x = right - frame.size.width;
    self.frame = frame;
}

- (CGFloat)stal_bottom {
    return self.frame.origin.y + self.frame.size.height;
}

- (void)setStal_bottom:(CGFloat)bottom {
    CGRect frame = self.frame;
    frame.origin.y = bottom - frame.size.height;
    self.frame = frame;
}

- (CGFloat)stal_width {
    return self.frame.size.width;
}

- (void)setStal_width:(CGFloat)width {
    CGRect frame = self.frame;
    frame.size.width = width;
    self.frame = frame;
}

- (CGFloat)stal_height {
    return self.frame.size.height;
}

- (void)setStal_height:(CGFloat)height {
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}

- (CGPoint)stal_origin {
    return self.frame.origin;
}

- (void)setStal_origin:(CGPoint)origin {
    CGRect frame = self.frame;
    frame.origin = origin;
    self.frame = frame;
}

- (CGSize)stal_size {
    return self.frame.size;
}

- (void)setStal_size:(CGSize)size {
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}
- (void)setStal_centerX:(CGFloat)centerX
{
    CGPoint center = self.center;
    center.x = centerX;
    self.center = center;
}

- (CGFloat)stal_centerX
{
    return self.center.x;
}

- (void)setStal_centerY:(CGFloat)centerY
{
    CGPoint center = self.center;
    center.y = centerY;
    self.center = center;
}

- (CGFloat)stal_centerY
{
    return self.center.y;
}
@end
